<?php

namespace application\model;

use application\model\BaseModel as BaseModel;
use application\entity\db\CpFunctionGroup;

class CpFunctionGroupModel extends BaseModel {

    public function __construct() {
        parent::__construct(CpFunctionGroup::class);
    }

    /**
     * Tìm theo groupname
     * @param type $groupName
     * @return type
     */
    public function findByGroupName($groupName) {
        $cri = new \core\entity\Criteria();
        $cri->andKey("name")->is($groupName);
        $query = new \core\entity\Query($cri);
        return $this->ifindOne($query);
    }

}
